using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Threading;
using System.Configuration;
using System.Reflection;

namespace MSRI.DesktopAgent
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Mutex mutex = null;
            bool createdNew = false;
            try
            {
                mutex = new Mutex(true, Assembly.GetExecutingAssembly().FullName, out createdNew);
                if (createdNew)
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new AgentForm());
                }
            }
            finally
            {
                if (mutex != null && createdNew)
                {
                    mutex.ReleaseMutex();
                }
            }
        }
    }
}